//
//  ZFJPopManagerHeader.h
//  GSDemo
//
//  Created by ZhangFujie on 2022/10/12.
//

#ifndef ZFJPopManagerHeader_h
#define ZFJPopManagerHeader_h

@class ZFJPopModel;

/// 动画样式
typedef NS_ENUM(NSInteger, ZFJPopAnimateStyle) {
    ZFJAnimateFromTop    = 0, /// 动画从上面出现
    ZFJAnimateFromLeft   = 1, /// 动画从左边出现
    ZFJAnimateFromRight  = 2, /// 动画从右边出现
    ZFJAnimateFromBottom = 3, /// 动画从下面出现
    ZFJAnimateByScale    = 4, /// 动画从中间放大出现
    ZFJAnimateNone       = 5  /// 无动画
};

/// 错误码的枚举
typedef NS_ENUM(NSInteger, ZFJPopErrorCode) {
    ZFJPopOKCode                 = 200, /// 正常，没有问题
    ZFJPopNoModelsCode           = 201, /// 没有数据源
    ZFJPopLastModelCode          = 202, /// 正着弹最后一个了，无需暂停了
    ZFJPopNoCurrentModelCode     = 203, /// 没有正着弹出的model
    ZFJPopNoCurrentViewNillCode  = 204, /// 自定义视图是空值
    ZFJPopWorkingCode            = 205, /// 已经正着监听中
};

/// void的block回调
typedef void(^ZFJPopVoidBlock)(void);
/// 带数据模型的回调
typedef void(^ZFJPopModelBlock)(ZFJPopModel *model);
/// 错误码回调
typedef void(^ZFJPopErrorBlock)(ZFJPopErrorCode errorCode);
/// 倒计时回调
typedef void(^ZFJPopCountDownBlock)(ZFJPopModel *model, NSInteger countDown);

/// 强制转换字符串
static inline NSString *kZFJPopStringValue(id str){
    if (!str || [str isKindOfClass:[NSNull class]]) {
        return @"";
    }
    if (![str isKindOfClass:[NSString class]]) {
        return [NSString stringWithFormat:@"%@", str];
    }
    return str;
}

/// 弱引用
#define ZFJPopWeakSelf __weak typeof(self) weakSelf = self;

#import "ZFJPopManager.h"
#import "ZFJPopModel.h"
#import "ZFJPopView.h"

#endif /* ZFJPopManagerHeader_h */
